﻿using Group3.MediaTool.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Group3.MediaTool.Data.IO;

namespace Group3.Data.Generator
{
    public class PrepareXMLFiles
    {

        public void prepareBookExport()
        {
            //String addData = "  <MAPPINGS>" +
            //                 "      <MAP>" +
            //                 "          <Attr>REF_BINDING01</Attr>" +
            //                 "          <RefClass>BINDING</RefClass>" +
            //                 "          <RefTab>REF_BINDING_book_01</RefTab>" +
            //                 "      </MAP>" +
            //                 "  </MAPPINGS>";

            String path = Path.Combine(StaticConfig.pathDataDefinition, "dataBook.xml");

            StreamReader sr = new StreamReader(path);

            String input = sr.ReadToEnd();

            string pattern = "\\s+";
            string replacement = " ";
            Regex rgx = new Regex(pattern);
            string result = rgx.Replace(input, replacement);

            StreamWriter sw = new StreamWriter(path,true);
            


        }



    }
}
